<!--
 * @name: 
 * @Author: JiaYing
 * @LastEditors: JiaYing
 * @Date: 2022-08-26 00:55:59
 * @LastEditTime: 2022-08-26 01:04:24
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>defineProperty</title>
  </head>
  <body></body>
</html>

<script>
  const user = {};
  const tony = Object.defineProperty(user, "name", {
    value: "tony",
    writable: false,
    configurable: false,
  });
  console.log(tony);

  delete tony.name;

  console.log(tony);

  tony.name = "jenny";

  console.log(tony);
</script>
